import java.net.*;
import java.io.*;

/**
 * 
 */

/**
 * @author terratack
 *
 */
public class Server{
	ServerSocket serwer = null;
	Socket client = null;
	private BufferedReader in = null;
	public Server() throws IOException{
		serwer = new ServerSocket(60000);
	}

    public void listenSocket() throws IOException{
    	
        while(true)
        {
	        client = serwer.accept();
	        System.out.println("Nawiazano polaczenie");
	        new Watek(client).start();
	        /*in = new BufferedReader(new InputStreamReader(client.getInputStream()));
	        String line = in.readLine();
			if(line.compareTo("start") == 1){
				System.out.println("polaczylem sie z watkiem");
			}*/
        }
    }
	public static void main(String[] args) throws IOException{
		Server dupa = new Server();
		dupa.listenSocket();
	}
}
